package com.dili.dd.gpi.mapper;

import com.dili.dd.gpi.domain.GciSnapshot;
import com.dili.dd.gpi.domain.GciSnapshotExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface GciSnapshotMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int countByExample(GciSnapshotExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int deleteByExample(GciSnapshotExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    @Delete({
        "delete from gci_snapshot",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    @Insert({
        "insert into gci_snapshot (`prefix`, gci, ",
        "suffix, `type`, ",
        "title, `describe`, ",
        "deleted, create_time, ",
        "update_time)",
        "values (#{prefix,jdbcType=VARCHAR}, #{gci,jdbcType=VARCHAR}, ",
        "#{suffix,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR,typeHandler=org.apache.ibatis.type.EnumTypeHandler}, ",
        "#{title,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, ",
        "#{deleted,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(GciSnapshot record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int insertSelective(GciSnapshot record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    List<GciSnapshot> selectByExample(GciSnapshotExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    @Select({
        "select",
        "id, `prefix`, gci, suffix, `type`, title, `describe`, deleted, create_time, ",
        "update_time",
        "from gci_snapshot",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    GciSnapshot selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int updateByExampleSelective(@Param("record") GciSnapshot record, @Param("example") GciSnapshotExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int updateByExample(@Param("record") GciSnapshot record, @Param("example") GciSnapshotExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    int updateByPrimaryKeySelective(GciSnapshot record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table gci_snapshot
     *
     * @mbggenerated Tue Mar 24 18:51:27 CST 2015
     */
    @Update({
        "update gci_snapshot",
        "set `prefix` = #{prefix,jdbcType=VARCHAR},",
          "gci = #{gci,jdbcType=VARCHAR},",
          "suffix = #{suffix,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=VARCHAR,typeHandler=org.apache.ibatis.type.EnumTypeHandler},",
          "title = #{title,jdbcType=VARCHAR},",
          "`describe` = #{describe,jdbcType=VARCHAR},",
          "deleted = #{deleted,jdbcType=BIT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(GciSnapshot record);
}